#pragma once
#include "GSE_SqlCommand.h"

namespace GSE
{
	class SQLCommand;
	typedef boost::shared_ptr<SQLCommand> SQLCommandHandler;

	class GSE_DLL_API GSE_NOVTABLE ISqlConnection
	{
	public:
		virtual bool Connect(const char * strHost, const char * strUser, const char * strPwd, const char * strDB, uint uPort = 3306) = 0;
		virtual void Disconnect() = 0;
		SQLCommandHandler CreateCommand( const char * SQLtext )
		{
			return SQLCommandHandler(new SQLCommand(SQLtext, this));
		}
		virtual void AsyncExecute(SQLCommandHandler command) = 0;
		virtual uint ID() = 0;
		virtual uint32 EscapeString(const char * strSrc, uint uLen, char * strDst) = 0;

		GSE_INTERFACE_NONCOPY(ISqlConnection);
	};
}